from django.conf.urls import url, include

from teach.views import course
from teach.views import distribute

urlpatterns = [
    url(r'^course/$', course.course, name='course'),

    url(r'^course/add/$', course.course_add, name='course_add'),
    url(r'^course/edit/(?P<cid>\d+)/$', course.course_edit, name='course_edit'),
    url(r'^course/del/(?P<cid>\d+)/$', course.course_del, name='course_del'),

    url(r'^module/add/(?P<cid>\d+)/$', course.module_add, name='module_add'),
    url(r'^module/edit/(?P<cid>\d+)/(?P<mid>\d+)/$', course.module_edit, name='module_edit'),
    url(r'^module/del/(?P<cid>\d+)/(?P<mid>\d+)/$', course.module_del, name='module_del'),

    url(r'^daily/add/(?P<cid>\d+)/$', course.daily_add, name='daily_add'),
    url(r'^daily/edit/(?P<cid>\d+)/(?P<did>\d+)/$', course.daily_edit, name='daily_edit'),
    url(r'^daily/del/(?P<cid>\d+)/(?P<did>\d+)/$', course.daily_del, name='daily_del'),
    url(r'^daily/prev/(?P<did>\d+)/$', course.daily_prev, name='daily_prev'),

    url(r'^distribute/list/$', distribute.distribute_list, name='distribute_list'),
    url(r'^distribute/get/(\d+)/$', distribute.get_sheet, name='get_table'), # 获取表中数据
    url(r'^distribute/set/(\d+)/$', distribute.set_table, name='set_table'),
    url(r'^distribute/del/(\d+)/$', distribute.del_table, name='del_table'),
    url(r'^distribute/rename/(\d+)/$', distribute.rename, name='rename'),
    url(r'^distribute/add_sheet/$', distribute.add_sheet, name='add_sheet'),

]
